package com.sun.boostrap.controller;

import com.sun.boostrap.service.OssUploadFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/oss")
public class OssController {

    @Autowired
    private OssUploadFileService ossUploadFileService;

    @PostMapping("/upload")
    public String uploadFileOnOss(MultipartFile file){
       return ossUploadFileService.uploadFile(file);
    }
}
